/*
 * Copyright (c) 2008-2021 浩瀚深度 All Rights Reserved.
 *
 * <p>FileName: DataSourceContextHolder.java</p>
 *
 * @author zz
 * @date 2024/2/4
 * @version 1.0
 * History:
 * v1.0.0 2024/2/4 Create
 */
package com.sqlweb.sqlweb.config;

/**
 * <p>Title: DataSourceContextHolder</p>
 * <p>Description: </p>
 *
 * @author zz
 */
public class DataSourceContextHolder {
    private static final ThreadLocal<Integer> contextHolder = new ThreadLocal<>();

    public static void setDataSourceKey(Integer dataSourceKey) {
        contextHolder.set(dataSourceKey);
    }

    public static Integer getDataSourceKey() {
        return contextHolder.get();
    }

    public static void clearDataSourceKey() {
        contextHolder.remove();
    }
}

